package helloCV;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.IOException;

import javax.swing.JButton;
import javax.swing.JFrame;

public class HelloCv extends JFrame implements MouseListener{


	
	private JButton btn = new JButton("GO");
	
	public HelloCv(){
		super.add(btn);
		btn.addMouseListener(this);
		System.out.println(".");
		super.setVisible(true);
		super.pack();
		super.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}
	
	
	public static void main(String[] args) {
		new HelloCv();
	}


	public void mouseClicked(MouseEvent e) {
		try {
//			Runtime.getRuntime().exec("java -jar C:/Users/eric/Desktop/demo/demo.jar");
			  String[] cmd = new String[] {"cmd.exe","/C","java -jar C:/Users/eric/Desktop/demo/demo.jar"};
			  Runtime.getRuntime().exec(cmd);
//			Runtime.getRuntime().exec("notepad.exe");
		} catch (IOException e1) {
			e1.printStackTrace();
		}
	}


	public void mouseEntered(MouseEvent e) {}
	public void mouseExited(MouseEvent e) {}
	public void mousePressed(MouseEvent e) {}
	public void mouseReleased(MouseEvent e) {}

}
